package com.itheima.stock.algorithm;

import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.api.sharding.standard.RangeShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.RangeShardingValue;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;

/**
 * @author by itheima
 * @Date 2022/1/5
 * @Description 定义table的范围查询（选择）
 */
@Slf4j
public class RangeTableShardingAlgorithm4MarketInfos implements RangeShardingAlgorithm<Date> {

    /**
     * @param collection 分库的名称集合
     * @param rangeShardingValue 条件查询的范围
     * @return 在指定范围内的数据库名称集合
     */
    @Override
    public Collection<String> doSharding(Collection<String> collection, RangeShardingValue<Date> rangeShardingValue) {
        ArrayList<String> list = Lists.newArrayList("stock_market_index_info");
        return list;
    }
}
